import java.awt.Point;
import java.util.ArrayList;

public class Bloon
{

	private int damage;
	public Point location;
	private Point target;
	private ArrayList<Point> targetLocations = new ArrayList<Point>();
	private ArrayList<Integer> coords;
	private int targetCount;
	private int sleepTime;
	public boolean popped = false;

	
	
	
	public Bloon()
	{
		damage = 1;
		location = new Point(0, 330);
		targetLocations.add(new Point(93, 330));
		targetLocations.add(new Point(93, 140));
		targetLocations.add(new Point(226, 140));
		targetLocations.add(new Point(226, 527));
		targetLocations.add(new Point(45, 527));
		targetLocations.add(new Point(45, 655));
		targetLocations.add(new Point(480, 655));
		targetLocations.add(new Point(480, 440));
		targetLocations.add(new Point(335, 440));
		targetLocations.add(new Point(335, 264));
		targetLocations.add(new Point(479, 264));
		targetLocations.add(new Point(479, 59));
		targetLocations.add(new Point(284, 59));
		targetLocations.add(new Point(284, -50));
		target = targetLocations.get(0);
		targetCount = 0;
		sleepTime = 100;
	}
	
	public void move()
	{
		
		if(location.y <= -50)
		{
			popped = false;
			//also decrement health by damage
		}
		else
		{
			if(location.x == target.x && location.y == target.y)
			{
				targetCount++;
				target = targetLocations.get(targetCount);
			}
			
			if(location.x < target.x)
				location.move(location.x + 1, location.y);
			else if(location.x > target.x)
				location.move(location.x - 1, location.y);
			
			if(location.y < target.y)
				location.move(location.x, location.y + 1);
			else if(location.y > target.y)
				location.move(location.x, location.y - 1);
			
			//System.out.println(location.x + ", " + location.y);
			
				
		}
			
	}
	
	public Point getLocation(int x, int y)
	{
		return location;
	}
	
	public void remove()
	{
		popped = true;
	}
	
	public void pop()
	{
		//increment money
		//pop animation
		popped = true;
	}
}
